Ext.ns('ru.proburo.oms.components.grid');

/**
 * @class ru.proburo.oms.components.grid.AbstractEditableList
 * @extends Ext.grid.EditorGridPanel
 */
ru.proburo.oms.components.grid.AbstractEditableList = Ext.extend(Ext.grid.EditorGridPanel, {
    
    constructor: function(config)
	{
		config = config || {};
		
		this.sm = config.sm ? config.sm : new Ext.grid.RowSelectionModel();
        
        Ext.applyIf(config, {
			
            loadMask: 	false,
			stripeRows: true,
			
			//view: 	  new Ext.ux.grid.BufferView({forceFit: true}),
			viewConfig: {forceFit: true},
			tbar:     this.initTBar(),			
			bbar:     this.initBBar(),
			colModel: new Ext.grid.ColumnModel({
                defaults:
                {
                    width: 	  20,
                    sortable: true
                },
                columns: this.initColumns()
            }),
			
			clicksToEdit: 1
        });
        
        ru.proburo.oms.components.grid.AbstractEditableList.superclass.constructor.call(this, config);
    },
	
	initTBar: function()
	{
		return [];
	},
	
	initBBar: function()
	{
		return [];
	},
	
	initColumns: function()
	{
        throw new Error('Abstract method called.');
	}
});